package com.fh.service.impl;

import com.fh.mapper.ProductImgMapper;
import com.fh.mapper.ProductMapper;
import com.fh.mapper.ProductParamsMapper;
import com.fh.mapper.ProductSkuMapper;
import com.fh.model.Product;
import com.fh.model.ProductImg;
import com.fh.model.ProductParams;
import com.fh.model.ProductSku;
import com.fh.model.vo.ProductVO;
import com.fh.service.ProductParamsService;
import com.fh.service.ProductService;
import com.fh.utils.ResultState;
import com.fh.vo.ResultVo;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class ProductParamsServiceImpl implements ProductParamsService {
@Resource
private ProductParamsMapper productParamsMapper;


    @Override
    public ResultVo selectParams(String productId) {
        Example example = new Example(ProductParams.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("productId",productId);
        ProductParams productParams = productParamsMapper.selectOneByExample(example);
        return new ResultVo(ResultState.OK,"ok",productParams);
    }
}
